home *** CD-ROM | disk | FTP | other *** search
- Path: news.rain.org!usenet
- From: "Guus Leeuw jr." <guusl@eiffel.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Why don't you use garbage collection
- Date: Wed, 17 Apr 1996 13:28:32 -0700
- Organization: Interactive Software Engineering Inc. http://www.eiffel.com/
- Message-ID: <31755470.3D85BB11@eiffel.com>
- References: <AD94A731966836BF@dialup97-6-14.swipnet.se> <1996Apr16.110526.1846@ittpub> <AD9A9E819668CB68B@dialup100-3-15.swipnet.se> <4l2qc9$oek@ubszh.fh.zh.ubs.com>
- NNTP-Posting-Host: @outback.eiffel.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; Linux 1.2.8 i586)
-
- Ian Johnston (by ubsswop) wrote:
- >
- > In article <AD9A9E819668CB68B@dialup100-3-15.swipnet.se>, lars.farm@nts.mh.se (Lars Farm) writes:
- > |> In article <1996Apr16.110526.1846@ittpub>,
- > |> wil@ittpub.nl (Wil Evers) wrote:
- > |>
- > |> >OK, let's get serious about this:
- > |> >
- > |> >1. Don't we think C++ is complex enough as it is?
- > |>
- > |> See the Detlefs/Ellis GC proposal. Seems a fairly small change in the
- > |> language compared to what is done with templates and exceptions and rtti,
- > |> and... A couple of keywords: gc/nogc to be used optionally with class
- > |> declarations and optionally with operator new to select collected or non
- > |> collected heap. Later gc/nogc overrides previous. There is a way to
- > |> finalize, but the need for this is made much smaler. What is inside most
- > |> copy/op=/dtors? Code to copy heap data and release data held by pointers.
- > |> What would copy/op=/dtors look like when pointers can be shared and you
- > |> don't have to say delete? Many of them would become redundant! The
- > |> (current) compiler generated op= and copy would very often suffice. The
- > |> minority of objects with non empty dtors would be deleted manually just
- > |> like now. This makes things simpler, not harder.
- >
- > Well, most of your classes may manage memory in ctors/dtors/op =, but
- > I have many many classes which manage other resources, not memory. In fact,
- > the classes I have which manage memory are in the minority.
- >
- > So, how does the Detlefs/Ellis, or any other GC, finalise my non-memory
- > resources?
-
- I don't know about Detlefs/Ellis GC (didn't follow this thread completely) but there
- is a GC out there, that calls a special function before actually destorying the
- object. The default body would be empty, and the user can override that default to
- close files or whatever.
-
- --
- 'l8r,
- Guus
- ---------------------------------------------------------------------------
- They say I'm wild and I'm reckless.
- -- Jim Steinman (from the song: Everything louder than everything else)
- ---------------------------------------------------------------------------
-